package me.numark.view;

import android.content.Context;
import android.content.Intent;
import android.text.style.ClickableSpan;
import android.view.View;

import me.numark.ProfileActivity;
import me.numark.model.User;

/**
 * Created by Evan on 14/12/6.
 */
public class UserClickSpan extends ClickableSpan {

    User mUser;

    public UserClickSpan(User user) {
        super();
        mUser = user;
    }

    @Override
    public void onClick(View widget) {
        Context context = widget.getContext();
        Intent intent = new Intent(context, ProfileActivity.class);
        intent.putExtra(ProfileActivity.EXTRA_UID, String.valueOf(mUser.uid));
        context.startActivity(intent);
    }
}
